From 44df8fa926b2630a3b363766f49ff658d7531940 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 12 Feb 2025 23:02:57 +0100 Subject: [PATCH] basically try to enforce the windows compatibility as guess from server for now simple rule to guess if the server has windows naming enforced if windows naming is enforced, we enforce it for new files if not, we do not care for now limited to spaces removal more to come Signed-off-by: Matthieu Gallien --- src/libsync/discovery.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 646808147..aa6696810 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -290,7 +290,7 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent const auto hasLeadingOrTrailingSpaces = excluded == CSYNC_FILE_EXCLUDE_LEADING_SPACE || excluded == CSYNC_FILE_EXCLUDE_TRAILING_SPACE || excluded == CSYNC_FILE_EXCLUDE_LEADING_AND_TRAILING_SPACE; - const auto leadingAndTrailingSpacesFilesAllowed = _discoveryData->_leadingAndTrailingSpacesFilesAllowed.contains(_discoveryData->_localDir + path); + const auto leadingAndTrailingSpacesFilesAllowed = !_discoveryData->_shouldEnforceWindowsFileNameCompatibility || _discoveryData->_leadingAndTrailingSpacesFilesAllowed.contains(_discoveryData->_localDir + path); if (hasLeadingOrTrailingSpaces && (wasSyncedAlready || leadingAndTrailingSpacesFilesAllowed)) { excluded = CSYNC_NOT_EXCLUDED; } @@ -470,6 +470,7 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent } item->_errorString = reasonString.isEmpty() ? errorString : QStringLiteral("%1 %2").arg(errorString, reasonString); item->_status = SyncFileItem::FileNameInvalidOnServer; + maybeRenameForWindowsCompatibility(_discoveryData->_localDir + item->_file, excluded); break; } } -- 2.30.2